//
//  EBHEndChatView.m
//  EBHDoctor
//
//  Created by 黄德玉 on 2019/11/16.
//  Copyright © 2019 DCloud. All rights reserved.
//

#import "EBHEndChatView.h"
#import "Masonry.h"
#import "DYGlobal.h"

@interface EBHEndChatView ()

@property (nonatomic, strong) UILabel * topLbl;
@property (nonatomic, strong) UILabel * btmLbl;

@end

@implementation EBHEndChatView


- (instancetype)init{
    if (self = [super init]) {
        
        UIView *view = [[UIView alloc] init];
        view.frame = CGRectMake(0,616,375,49);
        view.backgroundColor = [UIColor colorWithRed:254/255.0 green:254/255.0 blue:254/255.0 alpha:1.0];
        view.layer.shadowColor = [UIColor colorWithRed:179/255.0 green:138/255.0 blue:221/255.0 alpha:0.15].CGColor;
        view.layer.shadowOffset = CGSizeMake(0,0);
        view.layer.shadowOpacity = 1;
        view.layer.shadowRadius = 5;
        [self addSubview:view];
        [view mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.equalTo(self);
            make.height.equalTo(@50);
            make.bottom.equalTo(self).offset(- YG_HOME_INDICATOR_HEIGHT);
        }];
        UITapGestureRecognizer * ges = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)];
        [view addGestureRecognizer:ges];
        
        _btmLbl = [[UILabel alloc] init];
        _btmLbl.frame = CGRectMake(158,633.5,59,14.5);
        _btmLbl.numberOfLines = 0;
        [self addSubview:_btmLbl];

        NSMutableAttributedString *astring = [[NSMutableAttributedString alloc] initWithString:@"立即回访" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:15],NSForegroundColorAttributeName: [UIColor colorWithRed:173/255.0 green:133/255.0 blue:252/255.0 alpha:1.0]}];

        _btmLbl.attributedText = astring;
        [view addSubview:_btmLbl];
        [_btmLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(view);
        }];
        
        self.topLbl = [[UILabel alloc] init];
        _topLbl.numberOfLines = 0;
        [self addSubview:_topLbl];
        NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"本次回访已结束" attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:13],NSForegroundColorAttributeName: [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0]}];
        _topLbl.attributedText = string;
        [self.topLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.bottom.equalTo(view.mas_top).offset(-17);
            make.top.equalTo(self);
            make.height.equalTo(@20);
        }];
    }
    return self;
}

- (void)tapAction{
    if (self.tapActionBlcok) {
        self.tapActionBlcok();
    }
}


@end
